package cn.bugstack.test.infrastructure;


import cn.bugstack.infrastructure.persistent.dao.IAwardDao;
import cn.bugstack.infrastructure.persistent.dao.IStrategyAwardDao;
import cn.bugstack.infrastructure.persistent.dao.IStrategyDao;
import cn.bugstack.infrastructure.persistent.po.Award;
import cn.bugstack.infrastructure.persistent.po.Strategy;
import cn.bugstack.infrastructure.persistent.po.StrategyAward;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

/**
 * 奖品品持久化测试
 */

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class AwardDaoTest {

    @Autowired
    private IAwardDao iAwardDao;

    @Autowired
    private IStrategyDao iStrategyDao;

    @Autowired
    private IStrategyAwardDao iStrategyAwardDao;

    @Test
    public void test_queryAwardList(){
//        List<Award> awards = iAwardDao.queryAwardList();
//        log.info("测试结果：" + JSON.toJSONString(awards));

        //读取Strategy表
//        List<Strategy> strategies = iStrategyDao.queryStrategyList();
//        log.info("测试结果：" + JSON.toJSONString(strategies));

        //读取Strategy_award表
        List<StrategyAward> strategyAwards = iStrategyAwardDao.queryStrategyAwardList();
        log.info("测试结果：" + JSON.toJSONString(strategyAwards));





    }
}
